package p4.code;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class MethodFiled {

    public static int count = 0;

    public static int Method() {
        int a = 1;
        a++;
        return a;
    }

    public static void main(String[] args) {
        //线程池
        ExecutorService executorService = Executors.newCachedThreadPool();

        for(int i=0;i<500;i++) {
            executorService.execute(()-> {
                try{
                    count = Method();
                }catch(Exception e){
                    e.printStackTrace();
                }
            });
        }
        System.out.println(count);
    }
}
